#!/usr/bin/python3
# -*- coding:utf-8 -*-
""""
   @Author: 叶建伟
   @Email: yejw46507@hundsun.com
   @Time: 2022/6/21 9:32
   @File: 数据核查与统计.py
"""
import time

from 基础公共脚本.公共方法_hui2 import open_menu,arm_form_fill
from 基础公共脚本.步骤检查_hui2 import FE,assert_except

def scene_check_number(input_data=None, ui_expect=None):
    for i in range(1, 10):
        open_menu({'子系统名称': '反洗钱系统', '菜单名称': '首页'})
        time.sleep(1)
        text = FE.button(idname={'xpath':'//div[@class="data-check-wrap"]/ul[1]/li['+str(i)+']/span'}).get_text()
        print(text)
        FE.button(idname={'xpath':'//div[@class="data-check-wrap"]/ul[1]/li['+str(i)+']/a'}).click()
        text1 = FE.button(idname={'xpath':'//h2'}).get_text()
        print(text1)
        assert_except(text1,text)
        time.sleep(1)
        search_form = FE.form(idname={'xpath':'//form[@id="mainSearch"]'})
        # 表单填入
        search_form.button_option('重置')
        search_form.button_option('更多')
        search_form.auto_fill(input_data)
        search_form.button_option('查询')


def scene_check_number_more(input_data=None, ui_expect=None):
        open_menu({'子系统名称': '反洗钱系统', '菜单名称': '首页'})
        time.sleep(1)
        FE.button(idname={'xpath': '//p[contains(text(),"数据核查与统计")]/a[contains(text(),"更多")]'}).click()

